using System;
using System.Configuration;


namespace BIUtilities.Publish.CustomConfiguration
{
    /// <summary>
    /// The parent root node for the configuration
    /// </summary>
    public class DeploymentSettingsElement :
        System.Configuration.ConfigurationSection, IUpdatableConfig
    {
        /// <summary>
        /// Root node containing all deployments
        /// </summary>
        [ConfigurationProperty("", IsRequired=true, IsKey=false, IsDefaultCollection=true)]
        public DeploymentElementCollection Deployments
        {
            get { return (DeploymentElementCollection)this[""]; }
            set { this[""] = value; }
        }

        /// <summary>
        /// Makes this element editable
        /// </summary>
        /// <returns></returns>
        public override bool IsReadOnly()
        {
            return false;
        }


        #region IUpdatableConfig Members
        /// <summary>
        /// Creating a public accessor to get at the property values
        /// </summary>
        /// <param name="propertyName"></param>
        /// <returns></returns>
        object IUpdatableConfig.this[string propertyName]
        {
            get { return base[propertyName]; }
            set { base[propertyName] = value; }
        }
        #endregion
    }
}
